<link rel="stylesheet" href="/js/static/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/js/static/select2/4.0/select2.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/icheck/1.0/minimal/grey.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/jqGrid/4.7/css/ui.jqgrid.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/adminlte/css/AdminLTE.min.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/common/jeesite.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/adminlte/css/skins/skin-blue-light2.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/common/common.css?V4.2-01140807">
<script src="/js/global.min.js?ctx=/js/a"></script>
<script src="/js/static/jquery/jquery-3.5.0.min.js"></script>
<script src="/js/static/jquery/jquery-migrate-3.2.0.min.js"></script>
<script src="/js/static/bootstrap/js/bootstrap.min.js"></script>
<script src="/js/static/select2/4.0/select2.js?V4.2-01141009"></script>
<script src="/js/static/select2/4.0/i18n/zh_CN.js?V4.2-01141009"></script>
<script src="/js/static/layer/3.1/layer.js?V4.2-01141009"></script>
<script src="/js/static/laydate/5.0/laydate.js?V4.2-01141009"></script>
<script src="/js/static/jquery/jquery-ui-sortable-1.12.1.min.js"></script>
<script src="/js/static/jqGrid/4.7/js/jquery.jqGrid.js?V4.2-01141009"></script>
<script src="/js/static/jqGrid/4.7/js/jquery.jqGrid.extend.js?V4.2-01141009"></script>
<script src="/js/static/jqGrid/4.7/js/i18n/zh_CN.js?V4.2-01141009"></script>
<script src="/js/static/jquery-validation/1.16/jquery.validate.js?V4.2-01141009"></script>
<script src="/js/static/jquery-validation/1.16/localization/messages_zh_CN.js?V4.2-01141009"></script>
<script src="/js/static/jquery-validation/1.16/jquery.validate.extend.js?V4.2-01141009"></script>
<script src="/js/static/common/jeesite.js?V4.2-01141009"></script>
<script src="/js/static/common/i18n/jeesite_zh_CN.js?V4.2-01141009"></script>
<script src="/js/static/common/common.js?V4.2-01141009"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/bignumber.js/9.0.1/bignumber.js"></script>
<form class="form-horizontal">
    <div class="col-xs-6">
        <div class="form-group">
            <label class="control-label col-sm-4" title="">
                <span class="required hide">*</span> ${text('库存数量')}：<i class="fa icon-question hide"></i></label>
            <div class="col-sm-8">
                <input type="text" id="warehouseNumber" name="warehouseNumber" maxlength="20" class="form-control"
                       value="${bean.warehouseNumber}"
                       readonly
                       aria-invalid="false">
            </div>
        </div>
    </div>
    <div class="col-xs-6">
        <div class="form-group">
            <label class="control-label col-sm-4" title="">
                <span class="required hide">*</span> ${text('需求数量')}：<i class="fa icon-question hide"></i></label>
            <div class="col-sm-8">
                <input type="text" id="needNumber" name="needNumber" maxlength="20" class="form-control" readonly
                       value="${bean.needNumber}"
                       aria-invalid="false">
            </div>
        </div>
    </div>
    <div class="col-xs-6">
        <div class="form-group">
            <label class="control-label col-sm-4" title="">
                <span class="required hide">*</span> ${text('包装规格')}：<i class="fa icon-question hide"></i></label>
            <div class="col-sm-8">
                <input type="text" id="packType" name="packType" maxlength="20" class="form-control" readonly
                       value="20"
                       aria-invalid="false">
            </div>
        </div>
    </div>
    <div class="col-xs-6">
        <div class="form-group">
            <label class="control-label col-sm-4" title="">
                <span class="required hide">*</span> ${text('领料数量')}：<i class="fa icon-question hide"></i></label>
            <div class="col-sm-8">
                <input type="text" id="getNumber" name="getNumber" maxlength="20" class="form-control digits"
                       aria-invalid="false">
            </div>
        </div>
    </div>
    <div class="col-xs-6">
        <div class="form-group">
            <label class="control-label col-sm-4" title="">
                <span class="required hide">*</span> ${text('领料件量')}：<i class="fa icon-question hide"></i></label>
            <div class="col-sm-8">
                <input type="text" id="caseNumber" name="caseNumber" maxlength="20" class="form-control digits"
                       aria-invalid="false">
            </div>
        </div>
    </div>
    <script>
        $("#getNumber").bind("input propertychange", function () {
            var n1 = new BigNumber($("#getNumber").val());
            var n2 = new BigNumber($("#packType").val());
            var res = n1.div(n2).toNumber();
            $("#caseNumber").val(res);
        });
        $("#caseNumber").bind("input propertychange", function () {
            var n1 = new BigNumber($("#caseNumber").val());
            var n2 = new BigNumber($("#packType").val());
            var res = n1.times(n2).toNumber();
            $("#getNumber").val(res);
        });
        var canClose = true;

        function close() {
            if (-1 != $("#caseNumber").val().indexOf(".") || '' == $("#caseNumber").val().trim()) {
                canClose = false;
            } else {
                canClose = true;
            }
            return canClose;
        }

        function commit() {


            return {getNumber: $("#getNumber").val(), caseNumber: $("#caseNumber").val()};
        }
    </script>
</form>
